from ..components import Atomic
from ..primitives import chain

class Pause(Atomic):
    def __init__(self, condition):
        Atomic.__init__(self, "Simulation Pause")
        self.condition = condition
        
    @chain
    def initializer(self):
        yield self.condition
        self.pause_run()
        self.terminate()
        
